Developer Documentation
PATH  WebObjects 4.5 Documentation > Getting Started With Direct to Java Client

   

Adding an Additional Action

Direct to Java Client uses EOAction objects to describe the actions associated with menu commands and buttons.

The default Direct to Java Client rules provide hooks for adding to an application's actions--the commands available in the application's main menu. Recall that when an application starts up, it makes a rule system request with the request key availableActions. By default, the system populates an application's menu with commands to Quit, open the Query Window, and so on.

To add custom commands to the menu, you create a rule with the key additionalActions. The value should be a D2WComponent that generates XML to describe an EOAction. When the availableActions rule is fired, any rule with the request key additionalActions is also fired, and the resulting EOAction is added to the set of default actions.

To add the "About WebObjects" command to the Tools menu, do the following:

  1. Write a custom rule that specifies the following:

  2. Write the AboutWebObjectsActions D2WComponent

    AboutWebObjectsActions.html

    <WEBOBJECT name=aboutWebObjectsAction/>

    AboutWebObjectsActions.wod

    aboutWebObjectsAction: EOSwitchComponent {
      componentName = "EOHelpWindowAction";
      d2wContext = localContext;
      task = "aboutWebObjects";
      multipleWindowsAvailable = "false";
    }


© 1999 Apple Computer, Inc. – (Draft. Last updated 05 Jan 00)